<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 15-8-14
 * Time: 下午4:17
 */


if(!isset($_REQUEST['Action'])){
    $txt =  json_encode($_GET);
    logfile(date('Y-m-d H:i:s') . '|' .$txt ,'/var/www/html/new/d/logs/api/shenyouhuaxia/syhx_get_data.txt');//记录日志文件
    $array_order = json_decode($txt);
    $ordern = $array_order['Ordern'];
    logfile(date('Y-m-d H:i:s') . '|' .$ordern ,'/var/www/html/new/d/logs/api/shenyouhuaxia/syhx_get_data.txt');//记录日志文件
    exit("200|0|0|0||'票付通订单'号|'第三方订单号'");
}

$txt =  json_encode($_GET);
//logfile(date('Ymd H:i:s').'---'.$txt,'back.txt');//记录日志文件
//$txt ='{"VenueID":"","RoundID":"","AreaID":"","SeatID":"","Tnum":"0","Fid":"43396","Ordern":"2002671","Action":"MOD"}';
$array_action = json_decode($txt,true);


$action = (string)$array_action['Action'];
$paystatus = (string)$array_action['PayStatus'];
$orderid = (string)$array_action['Ordern'];
logfile(date('Y-m-d H:i:s') . '|' .random(1,100). '|' .$code. '|' .$message,'/var/www/html/new/d/logs/api/shenyouhuaxia/syhx_get_data.txt');//记录日志文件

if($action='MOD'){
        include '/var/www/html/new/d/module/qkxproject/api/all/all_test.php';

    $syhx = new Test();
             $response = $syhx->returnOrder($orderid);
          if($response==101){
              echo 101;
          }else{
              echo ('200|0|0');
          }



}
function logfile($txt, $path)
{
    $fp = fopen($path, "a");
    flock($fp, LOCK_EX);
    fwrite($fp, $txt . "\n");
    flock($fp, LOCK_UN);
    fclose($fp);
}